package com.costeaalex.blueserver.interfaces.setup;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import com.costeaalex.blueserver.setup.SetupServerApp;

public class ScreenSetupBluetoothOn extends JPanel
	{

	private static final long	serialVersionUID	= -3031970094695645618L;
	private JButton proceed;
	private SetupServerApp sSAL;
	private Listener l;
	private boolean actionPerformed=false;
	
	public ScreenSetupBluetoothOn(SetupServerApp sSA)
		{
		super();
		l=new Listener();
		sSAL=sSA;
		this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
		JLabel jTAS=new JLabel(" Setup ");
		this.add(jTAS);
		
		this.add(new JLabel("     "));
		this.add(new JLabel(" Please make sure bluetooth is on before proceeding."));
		this.add(new JLabel("     "));
		
		proceed=new JButton("Proceed");
		proceed.addActionListener(l);
		this.add(proceed);
		}

	public class Listener implements ActionListener
		{
		public void actionPerformed(ActionEvent a)
			{
			if(!actionPerformed)
				{
				actionPerformed=true;
				if(a.getSource()==proceed)
					{
					sSAL.startSetup();
					}
				}
			}
		}
	
	}
